#include<stdio.h>
#include<unistd.h>

int main()
{
  pid_t ret = fork();
  if(ret == 0)
  {
    while(1)
    {
      printf("我是子进程,我的pid是:%d\n",getpid());
      sleep(1);
    }
  }
  if(ret>0)
  {
    while(1)
    {
      printf("我是父进程,我的pid是:%d\n",getpid());
      sleep(1);
    }
  }
  return 0;
}
